package com.example.admin.service.impl;

import cn.hutool.core.util.IdUtil;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.admin.mapper.AdminMapper;
import com.example.admin.service.AdminService;
import com.example.xo.pojo.Admin;


import com.example.xo.pojo.Category;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@Slf4j
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;

    @Override
    public boolean login(Admin admin) {
//        List<Admin> list = adminMapper.selectList(wrapper);
        return false;
    }

    @Override
    public Admin findByEmail(String email) {
        LambdaQueryWrapper<Admin> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(Admin::getEmail,email);
        wrapper.isNull(Admin::getDeleted);
        Admin admin = adminMapper.selectOne(wrapper);
        return admin;
    }
}
